package cn.wolfcode.wolf2w.redis.util;

import cn.wolfcode.wolf2w.util.Consts;
import jdk.nashorn.internal.parser.Token;
import lombok.Getter;


@Getter
public enum RedisKeys {
    //顶
    STRATEGY_THUMB("strategy_thumb", -1L),
    //收藏key
    USER_STRATEGY_FAVOR("user_strategy_favor", -1L),
    //vokey
    STRATEGY_STATIS_VO("strategy_statis_vo", -1L),
   //短信
    VERIFY_CODE("verify_code", Consts.VERIFY_CODE_VAI_TIME * 60L),
    //登录
    USER_LOGIN("user_login", Consts.USER_INFO_TOKEN_VAI_TIME * 60L);
    private String prefix;
    private Long time;

    RedisKeys(String prefix, Long time) {
        this.prefix = prefix;
        this.time = time;
    }

    public String join(String... values) {
        StringBuilder sb = new StringBuilder(80);
        sb.append(this.prefix);

        for (String value : values) {
            sb.append(":").append(value);
        }
        return sb.toString();

    }
}
